/*
 * Created on 17 �.�. 2547
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.softplus.carrefour.hd.bltier.admin;

import java.util.List;
import java.util.Vector;

import net.sf.hibernate.HibernateException;

import com.softplus.carrefour.CFException;
import com.softplus.carrefour.hd.bltier.db.HibernateUtil;
import com.softplus.carrefour.hd.bltier.entity.CfhdEnvironment;
import com.softplus.carrefour.hd.bltier.entity.CfhdModule;

/**
 * @author Kowit
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class CFHDEnvironmentManage implements ICFHDEnvironmentControl, 
                                              ICFHDEnvironmentViewer {

    /* (non-Javadoc)
     * @see com.softplus.carrefour.hd.bltier.admin.ICFHDEnvironmentViewer#getListSystem()
     */

    public Vector getListEnvironment() throws CFException {
        List ls = null;
        try {
            ls = 
 HibernateUtil.getSession().createCriteria(CfhdEnvironment.class).list();
        } catch (HibernateException e) {
            e.printStackTrace();
        } finally {
            HibernateUtil.closeSession();
        }

        Vector modules = new Vector();
        for (int i = 0; i < ls.size(); i++) {
            modules.addElement(((CfhdEnvironment)ls.get(i)).getCfhdEnvironment());
        }
        return modules;
    }

}
